<template>
  <div class="data-analysis">
    <div class="analysis-header">
      <h2 class="title">数据分析</h2>
      <p class="subtitle">网站运营数据统计与分析</p>
    </div>
    <el-row :gutter="24">
      <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8" class="mb24">
        <article-category-chart />
      </el-col>
      <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8" class="mb24">
        <user-source-chart />
      </el-col>
      <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8" class="mb24">
        <user-region-chart />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import UserSourceChart from './components/UserSourceChart.vue'
import ArticleCategoryChart from './components/ArticleCategoryChart.vue'
import UserRegionChart from './components/UserRegionChart.vue'

export default {
  name: 'DataAnalysis',
  components: {
    UserSourceChart,
    ArticleCategoryChart,
    UserRegionChart
  }
}
</script>

<style lang="less" scoped>
.data-analysis {
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f2f5 100%);
  min-height: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
  }

  .analysis-header {
    position: relative;
    z-index: 2;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);

    .title {
      font-size: 20px;
      font-weight: 500;
      color: #1f2329;
      margin: 0 0 8px;
    }

    .subtitle {
      font-size: 14px;
      color: #646a73;
      margin: 0;
    }
  }

  .mb24 {
    margin-bottom: 24px;
  }

  :deep(.chart-container) {
    height: 360px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 100%;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
      pointer-events: none;
    }

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }
  }

  .el-row {
    position: relative;
    z-index: 2;
    margin-left: -12px !important;
    margin-right: -12px !important;
  }

  .el-col {
    height: 360px;
    padding: 0 12px;
  }
}

@media screen and (max-width: 768px) {
  .data-analysis {
    padding: 16px;

    .analysis-header {
      margin-bottom: 16px;
      padding-bottom: 12px;

      .title {
        font-size: 18px;
      }

      .subtitle {
        font-size: 13px;
      }
    }

    :deep(.chart-container) {
      height: 320px;
    }

    .el-col {
      height: 320px;
    }
  }
}
</style>